//
//  RequestOperation.h
//  OCBase
//
//  Created by 侯伟 on 2017/8/10.
//  Copyright © 2017年 侯伟. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "RequestConfig.h"
#import "UploadFile.h"
#import "HRequest.h"
#import "HResponse.h"


@interface RequestOperation : NSObject

/**
 主机地址
 */
@property (class,nonatomic,copy)NSString* URL;


/**
 设置请求头部信息
 
 @param requestHeader -
 */
+ (void)setRequestHeader:(NSDictionary<NSString*,NSString*> *)requestHeader;

/**
 *  通用：Model请求（请求数据为model）
 *  quite YES静态加载
 */
+ (void)request:(HRequest *)request quite:(BOOL)quite callBack:(ResponseBlock)callBack;


/**
 *  加密：Model请求（请求数据为model）
 *  quite YES静态加载
 */
+ (void)encryptedRequest:(HRequest *)request quite:(BOOL)quite callBack:(ResponseBlock)callBack;


/// 通用请求
/// @param url 完整地址
/// @param parmas 参数
/// @param method 方式
/// @param quite quite YES静态加载
/// @param callBack -
+ (void)request:(NSString *)url parmas:(NSDictionary*)parmas method:(RequestMethod)method quite:(BOOL)quite callBack:(RequestResult)callBack;


/// 通用加密请求
/// @param url 完整地址
/// @param parmas 参数
/// @param method 方式
/// @param quite quite YES静态加载
/// @param callBack -
+ (void)encryptedRequest:(NSString *)url parmas:(NSDictionary*)parmas method:(RequestMethod)method quite:(BOOL)quite callBack:(RequestResult)callBack;


/**
 *  上传文件
 *  quite YES静态加载
 */
+ (void)upload:(HRequest*)request files:(NSArray<UploadFile *> *)files quite:(BOOL)quite callBack:(ResponseBlock)callBack;

/**
 *  监听网络状态
 *  notReachable     yes:无网  no:有网
 */
+ (void)startMonitoringWithResult:(void(^)(BOOL available))block;

/**
 停止监听
 */
+ (void)stopMonitoring;


@end
